package cn.jinjimi.app.managers;

import cn.jinjimi.app.entity.Company;
import cn.jinjimi.app.entity.ZdbAge;
import cn.jinjimi.app.entity.ZdbInsurancesType;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Roy
 * Date: 2017/3/21
 */

public class ZdbFilterManager {

    private List<ZdbInsurancesType> insuranceListData = new ArrayList<>();
    private List<Company> companiesListData = new ArrayList<>();
    private List<ZdbAge> zdbAgeListData = new ArrayList<>();

    private static volatile ZdbFilterManager instance = null;

    public static ZdbFilterManager getInstance() {
        if (instance == null) {
            synchronized (ZdbFilterManager.class) {
                if (instance == null)
                    instance = new ZdbFilterManager();
            }
        }
        return instance;
    }

    public List<ZdbInsurancesType> getInsuranceListData() {
        return insuranceListData;
    }

    public void setInsuranceListData(List<ZdbInsurancesType> insuranceListData) {
        if (insuranceListData == null)
            insuranceListData = new ArrayList<>();
        this.insuranceListData.clear();
        this.insuranceListData.addAll(insuranceListData);
    }

    public List<Company> getCompaniesListData() {
        return companiesListData;
    }

    public void setCompaniesListData(List<Company> companiesListData) {
        if (companiesListData == null)
            companiesListData = new ArrayList<>();
        this.companiesListData.clear();
        this.companiesListData.addAll(companiesListData);
    }

    public List<ZdbAge> getZdbAgeListData() {
        return zdbAgeListData;
    }

    public void setZdbAgeListData(List<ZdbAge> zdbAgeListData) {
        if (zdbAgeListData == null)
            zdbAgeListData = new ArrayList<>();
        this.zdbAgeListData.clear();
        this.zdbAgeListData.addAll(zdbAgeListData);
    }
}
